home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-28 | 3.7 KB | 157 lines | [TEXT/MPS ] |
- // Copyright © 1993-94 Apple Computer, Inc. All rights reserved.
-
- constant kAppSymbol := '|LondonCalling:PIEDTS|;
-
- // ---- End Project Data ----
-
-
- // ---- File main.t ----
- myBase :=
- {viewBounds: {left: -1, top: 26, right: 219, bottom: 293},
- viewScrollDownScript:
- func()
- begin
- CountryList:viewScrollDownScript();
- end,
- viewScrollUpScript:
- func()
- begin
- CountryList:viewScrollUpScript();
- end,
- title: "London Calling",
- UpdatePhone:
- func()
- begin
- // get the country name from the countryList view
- local cl := countryList ;
- local cName := cl.listItems[cl.selection] ;
-
- // set the value of the convertedText static text
- // item to the output from MungePhone.
- SetValue(convertedText, 'text,
- :MungePhone(phoneLine.entryLine.text, cName);
- );
- end,
- _proto: protoApp,
- debug: "myBase"
- };
-
- convertedText := /* child of myBase */
- {text: "",
- viewBounds: {left: 7, top: 166, right: 215, bottom: 214},
- viewFormat: 337,
- _proto: protoStaticText,
- debug: "convertedText"
- };
- // View convertedText is declared to myBase
-
-
-
- _view000 := /* child of myBase */
- {text: "Converted Number",
- viewBounds: {left: 6, top: 150, right: 110, bottom: 166},
- _proto: protoStaticText
- };
-
-
-
- phoneLine := /* child of myBase */
- {viewBounds: {left: 3, top: 21, right: 221, bottom: 45},
- label: "Phone:",
- text: "415 555 1212",
- entryFlags: 273921,
- labelCommands: ["408 555 1212", "415 555 1212", "81 555 1212"],
- _proto: protoLabelInputLine,
- debug: "phoneLine"
- };
- // View phoneLine is declared to myBase
-
-
-
- CountryList := /* child of myBase */
- {viewBounds: {left: 67, top: 51, right: 218, bottom: 145},
- viewSetupFormScript:
- func()
- begin
- // get an array of all the countries that Newton
- // can convert phone numbers for
- c :=
- foreach item in ROM_countries collect item.name ;
-
- // sort that array alphabetically
- c := Sort(c, '|str<|, nil);
-
- // and set the list items to that array
- self.listItems := c ;
-
- // setup the list
- :SetupList();
- end,
- viewFont: ROM_fontSystem9,
- viewLines: 7,
- viewSetupDoneScript:
- func()
- begin
- // set the default selection to the line containing USA
- // make sure it is visible by scrolling down to it
- usaLine := ArrayPos(listItems, "USA", 0, func(a,b) StrEqual(a,b)) ;
- :DoScrollScript(MIN(usaLine * lineHeight, spillHeight)) ;
- selection := usaLine;
- end,
- _proto: protoTextList,
- debug: "CountryList"
- };
- // View CountryList is declared to myBase
-
-
-
- _view001 := /* child of myBase */
- {text: "Country of Phone Number",
- viewBounds: {left: 6, top: 50, right: 65, bottom: 112},
- viewJustify: 0,
- _proto: protoStaticText
- };
-
-
-
- Convert := /* child of myBase */
- {text: "Convert Phone",
- buttonClickScript:
- func()
- begin
- :UpdatePhone();
- end,
- viewBounds: {left: 11, top: 226, right: 95, bottom: 238},
- _proto: protoTextButton,
- debug: "Convert"
- };
-
-
-
- Options := /* child of myBase */
- {text: "Options",
- buttonClickScript:
- func()
- begin
- // set the invoker of the callOptionsSlip to be
- // the base view
- // NOTE: invoker must support the message UpdatePhone
- callOptionsSlip.invoker := base;
-
- // then open it
- callOptionsSlip:Toggle();
- end,
- viewBounds: {left: 115, top: 226, right: 183, bottom: 238},
- _proto: protoTextButton,
- debug: "Options"
- };
-
-
-
-
-
-
-
- // ---- Beginning of section for non used Layout files ----
-
- // End of output